home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / statep1a / menus.inc < prev    next >
Encoding:
Text File  |  1999-09-23  |  793 b   |  27 lines

  1. <%
  2. Sub Addmenu(menutype)
  3.     Set fs = CreateObject("Scripting.FileSystemObject")
  4.     If menutype="state" then
  5.         filename=server.mappath("/statelist-commadelim.txt")
  6.     Else
  7.         filename=server.mappath("/isocountry.txt")
  8.     End If
  9.     Set readfile=fs.OpenTextFile(filename,1,False)
  10.     Text=readfile.readline
  11.     Totalchars = Len(text)
  12.     Pointer = instr(text,",")
  13.     SCode = Left(text,Pointer-1)
  14.     Do until readfile.atendofstream
  15.         text=readfile.readline
  16.         Totalchars = Len(text)
  17.         Pointer = instr(text,",")
  18.         SCode = Left(text,Pointer-1)
  19.         SLabel = mid(text,Pointer+1)
  20.         If SCode="us" then
  21.             response.write "<option selected value=""" & SCode & """>" & SLabel & "</option>"
  22.         Else
  23.             response.write "<option value=""" & SCode & """>" & SLabel & "</option>"
  24.         End If
  25.     Loop
  26. End Sub
  27. %>